package servlet;

import bean.Announcement;
import dao.announcementDaoImpl;
import java.sql.SQLException;
import java.util.List;

public class announcementServiceImpl{
    private announcementDaoImpl announcementDao = new announcementDaoImpl();

    public List<Announcement> getAll() {
        return announcementDao.getAll();
    }

    public void insert(String announcement_title, String content, String time) {
        try{
            announcementDao.insert(announcement_title,content,time);
        }catch (SQLException throwables){
            throwables.printStackTrace();
        }
    }

    public void delete(String announcement_num){
        try{
            announcementDao.delete(announcement_num);
        }catch (SQLException throwables){
            throwables.printStackTrace();
        }
    }
}